﻿@{
    ViewBag.Title = "Tjxx";
    Layout = "~/Views/Shared/_MyLayout.cshtml";


    float a = 10.12345678f;

    for (int i = 0; i < 10; i++)
    {
        a++;
    }

    string num = a.ToString("f3");
}


@section head{
    <style type="text/css">
        #outermost_container {/*页面最外层容器样式*/
            width: 100%;
            height: 100%;
        }

        /*左右两个容器的样式*/
        #left_container { 
            width: 50%;
            height: 100%;
            float: left;
        }

        #right_container { 
            width: 50%;
            height: 100%;
            float: left;
        }

        /*上下两个容器的样式*/
        #top_container {
            width: 50%;
            height: 100%;
            float: left;
        }

        #bottom_container {
            width: 50%;
            height: 100%;
            float: left;
        }

    </style>
}

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>统计信息</legend>
</fieldset>


<div id="outermost_container">

    <div id="left_container" style="width: 50%; height: 100%; float: left;">

        <div style="float: left; width: 100px; height: 20%;">注册总人数</div>

        <div class="layui-icon layui-icon-user" style="width: 20%; height: 20%; display: inline-block;">@ViewBag.UserNum</div>

        <div style ="width:100%; height:80%;"><table id="UserTjxxTable" lay-filter="UserTjxxList"></table></div>

    </div>

    <div id="right_container" style="width: 50%; height: 100%; float: left;">

        <div style="float: left; width: 100px; height: 20%; ">总单据数量</div>

        <div class="layui-icon layui-icon-form" style="width: 20%; height: 20%; display: inline-block;">@ViewBag.MaintainNum</div>

        <div style="width:100%; height:80%;"><table id="MaintainTjxxTable" lay-filter="MaintainTjxxList"></table></div>

    </div>

</div>





<script type="text/javascript">
    var table;
    layui.use('table', function () {
        table = layui.table;//AAAA
        var tab = parent.tab;
        //第一个实例
        table.render({
            elem: '#UserTjxxTable'
            , method: 'post'
            //, height: 315
            , url: '/DataExchange/Table_User/' //数据接口
            , page: true //开启分页
            , where: { SortName: "user_id", Order: "ASC", Condition: " and IsDelete=0" }
            , limits: [10, 50, 100]
            , cols: [[ //表头
                { field: 'user_name', title: '用户名称', width: 100, fixed: 'left' }
                , { field: 'user_phone', title: '用户手机号', width: 150 }
                , {
                    field: 'user_type', title: '用户类型', width: 200,
                    templet: function (d) {
                        if (d.user_type == "1") {
                            return "管理员";
                        }
                        else if (d.user_type == "0") {
                            return "一般用户";
                        }
                    }
                }
            ]]
        });

        //第二个实例
        table.render({
            elem: '#MaintainTjxxTable'
            , method: 'post'
            //, height: 315
            , url: '/DataExchange/Table_Maintain/' //数据接口
            , page: true //开启分页
            , where: { SortName: "maintain_id", Order: "ASC", Condition: " and IsDelete=0" }
            , limits: [10, 50, 100]

            , cols: [[ //表头
                { field: 'maintain_no', title: '单据编号', width: 100, fixed: 'left' }
                , { field: 'product_name', title: '产品名称', width: 150 }
                , { field: 'problem_description', title: '问题描述', width: 150 }
                , {
                    field: 'state', title: '单据状态', width: 200,
                    templet: function (d) {
                        if (d.state == "3") {
                            return "结束";
                        }
                        else if (d.state == "2") {
                            return "维修中";
                        }
                        else if (d.state == "1") {
                            return "寄修中";
                        }
                        else if (d.state == "0") {
                            return "申请中";
                        }
                    }
                }
            ]]
        });
    });
</script>

